import i18n from '@/lang'
import moment from 'moment'
// 升级异常统计中表格表头
export const fotaMonitorColumns = [
  {
    title: 'VIN',
    dataIndex: 'vin',
    scopedSlots: { customRender: 'vin' },
    width: 100
  },
  {
    title: 'ECU ID',
    dataIndex: 'ecuId',
    scopedSlots: { customRender: 'ecuId' },
    width: 100
  },
  {
    title: 'ECU名称',
    dataIndex: 'ecuName',
    scopedSlots: { customRender: 'ecuName' },
    width: 140
  },
  {
    title: '任务名称',
    dataIndex: 'taskName',
    scopedSlots: { customRender: 'taskName' },
    width: 120,
    special: true
  },
  {
    title: '是否任务ecu',
    dataIndex: 'displayDetail',
    scopedSlots: { customRender: 'displayDetail' },
    width: 120
  },
  {
    title: '任务升级结果',
    dataIndex: 'upgradeResult',
    scopedSlots: { customRender: 'upgradeResult' },
    width: 120
  },
  {
    title: '[车端上报]ECU软件编码',
    dataIndex: 'ecuSoftCode',
    scopedSlots: { customRender: 'ecuSoftCode' },
    width: 180,
    special: true
  },
  {
    title: '[云端录入]ECU软件编码',
    dataIndex: 'cloudEcuSoftCode',
    scopedSlots: { customRender: 'cloudEcuSoftCode' },
    width: 180,
    special: true
  },
  {
    title: 'ECU目标版本',
    dataIndex: 'ecuSoftVer',
    scopedSlots: { customRender: 'ecuSoftVer' },
    width: 120,
    special: true
  },
  {
     title: 'ECU源版本',
     dataIndex: 'ecuOriginSVer',
     scopedSlots: {customRender: 'ecuOriginSVer'},
     width: 100
  },
  {
    title: '升级时长(s)',
    dataIndex: 'ecuTime',
    scopedSlots: { customRender: 'ecuTime' },
    width: 100
  },
  {
    title: 'ECU升级结果',
    dataIndex: 'ecuUpgradeResult',
    scopedSlots: { customRender: 'ecuUpgradeResult' },
    width: 140
  },
  {
    title: 'ECU状态码',
    dataIndex: 'ecuStatus',
    scopedSlots: { customRender: 'ecuStatus' },
    width: 100
  },
  {
    title: 'ECU升级描述',
    dataIndex: 'ecuReason',
    scopedSlots: { customRender: 'ecuReason' },
    width: 140
  },
  {
    title: '是否清除故障码',
    dataIndex: 'diagnosticTroubleCodeDel',
    scopedSlots: { customRender: 'diagnosticTroubleCodeDel' },
    width: 140
  },
  {
    title: '是否配置文件',
    dataIndex: 'configFile',
    scopedSlots: { customRender: 'configFile' },
    width: 120
  },
  {
    title: '故障码',
    dataIndex: 'diagnosticTroubleCode',
    scopedSlots: { customRender: 'diagnosticTroubleCode' },
    width: 80
  },
  {
    title: '硬件版本号',
    dataIndex: 'ecuHardVer',
    scopedSlots: { customRender: 'ecuHardVer' },
    width: 120
  },
  {
    title: '数据上报时间',
    dataIndex: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    customRender: (text, record, index) => {
      return moment(text).format('YYYY-MM-DD HH:mm:ss')
    },
    width: 180
  },
  {
    title: i18n.t('operation'),
    scopedSlots: { customRender: 'operation' },
    width: 100,
    fixed: 'right'
  }
]
